<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .nav_top {
            background-color: #f5f5f5;
        }

        #page-content.single-page {
            margin: 50px 0;
        }

        #page-content .row {
            margin-bottom: 30px;
        }

        .breadcrumb {
            margin-bottom: 40px;
            border: 1px solid #ddd;
        }

        .breadcrumb i {
            font-size: 15px;
        }

        .breadcrumb > li {
            text-shadow: 0 1px 0 #FFF;
            padding: 0 20px;
            position: relative;
            white-space: nowrap;
        }

        .breadcrumb > li + li:before {
            content: '';
            padding: 0;
        }

        .breadcrumb > li:after {
            content: '';
            display: block;
            position: absolute;
            top: -3px;
            right: -5px;
            width: 31px;
            height: 31px;
            border-right: 1px solid #DDD;
            border-bottom: 1px solid #DDD;
            -webkit-transform: rotate(-45deg);
            -moz-transform: rotate(-45deg);
            -o-transform: rotate(-45deg);
            transform: rotate(-45deg);
        }

    </style>
</head>
<body>
<div class="container-fluid nav_top">
    <div class="navbar-header">
        <a class="navbar-brand" th:href="@{/}">淘淘商城</a>
    </div>
    <div>
        <ul class="nav navbar-nav navbar-right">
            <li class="active" th:if="${session.user}==null"><a th:href="@{/login}">亲，请登录</a></li>
            <li class="dropdown" th:unless="${session.user}==null">
                <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                   aria-expanded="false" href="#">
                    <span th:text="'欢迎您:' + ${session.user.username} + '!'"></span><span class="caret"></span></a>
                <ul class="dropdown-menu">
                    <li><a th:href="@{/user/logout}">退出</a></li>
                </ul>
            </li>
            <li>
                <a th:href="@{/user/cartList}">购物车</a>
            </li>
            <li>
                <a th:href="@{/user/order}">我的订单</a>
            </li>
        </ul>
    </div>
</div>

<div id="page-content" class="single-page">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <ul class="breadcrumb">
                    <li>
                        <a th:href="@{/user/order}">我的订单</a>
                    </li>
                    <li>
                        <a href="#">订单详情</a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12 col-md-12 col-xs-12 "
                 style="margin-top: 10px;padding-top:10px;border: 1px solid #888888; border-radius:5px ">
                <div th:each="product:${order.productInfos}" class="row">
                    <div class="col-xs-3 col-sm-2" style="text-align: left">
                        <img th:src="@{${product.imageUrl}}" style="width: 150px; height: 150px;"/>
                    </div>
                    <div class="col-xs-5 col-sm-6">
                        <div style="text-align: left;margin: auto 0;">
                            <a th:href="@{/product/{id}(id=${product.id})}" th:text="${product.name}">华为畅享10全网通版</a>
                        </div>

                    </div>
                    <div class="col-xs-4" style=" text-align: right">
                        <p th:text="${product.nowPrice}">1399.00</p>
                        <span>x <span th:text="${product.num}">1</span></span>
                    </div>
                </div>
                <hr class="col-xs-12" style="padding: 0px;"/>
                <p class="col-xs-12" style="text-align: right">实付金额：<strong th:text="${order.allPrice}">1399.00</strong>元
                </p>
                <p class="text-left">订单编号：<span th:text="${order.id}">1234567890098765432</span></p>
                <p class="text-left">创建时间：<span th:text="${#dates.format(order.createTime,'yyyy-MM-dd ss:mm:ss')}">2020-5-22</span>
                </p>
                <p class="text-left">状态：<span th:if="${order.status}==1">已付款</span> <span
                        th:if="${order.status}==0">未付款</span></p>
                <p class="col-xs-12" style="text-align: right">
                    <a th:href="@{/user/order/cancel/{id}(id=${order.id})}">
                        <button class="btn btn-default" th:if="${order.status}==0">取消订单</button>
                    </a>
                    <a th:href="@{/user/pay/{id}(id=${order.id})}">
                        <button class="btn btn-default" th:if="${order.status}==0">前往支付</button>
                    </a>
                </p>

            </div>
        </div>
    </div>
</div>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>